//上传组件
Otod.file = {
		defaultOptions:{
			url: Global.ctx + "/servlet/upload",
			previewsContainer: '#_uploadDisplayDiv',
		    paramName: "file", // The name that will be used to transfer the file
		    maxFilesize: 5000, // MB
		    createImageThumbnails:false,
			addRemoveLinks : false,
			error: function(file, message){
				Otod.Msg.error(message.error);
			},
			clickable: true,
			isBusid:false,
			type:"commonManage"
		},
		init: function(uploadEl,options){
			this.options = $.extend({}, this.defaultOptions, options != null ? options : {});
			if(uploadEl){
				new Dropzone(uploadEl, this.options);
			}
		},
		download: function(id){
			var url = Global.ctx+"/servlet/upload?sname="+id+"&isBusid="+this.options.isBusid+"&type="+this.options.type;
			document.getElementById("_downloadFileFrame").src = url;
		},
		del : function(id,successFn){
			Otod.ajax({
				url: ctx + '/sys/file/deleteById.do',
				data : {"id":id},
				type : "GET",
				successFn : successFn?successFn:function(){}
			});
		}
};

//公用js 得到后台的随机数字
function getRadom(){
	var temp = "";
	Otod.ajax({
		url:Global.ctx+'/zTree/random/getZtree.do',	
		type:"GET",
		async: false,
		successFn:function(data){	
			temp =  data.info;
		}
	});
	return temp;
}


